<template>
  <div>
    <el-container>
      <el-aside width="200px">Aside</el-aside>
      <el-container>
        <el-header>
          <router-link :to="{ path: '/one/one/' + id }"
            ><el-button type="primary">子页面一</el-button></router-link
          >

          <router-link :to="{ name: 'oneTwo', query: { userid: 1 } }"
            ><el-button type="success">子页面二</el-button></router-link
          >

          <router-link to="/one/three">
            <el-button type="info">子页面三</el-button></router-link
          >

          <el-button type="info" @click="findManager">axios请求</el-button>
        </el-header>
        <el-main>
          <router-view />
        </el-main>
        <el-footer>Footer</el-footer>
      </el-container>
    </el-container>
  </div>
</template>
<style>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
<script>
import axios from "axios";
export default {
  methods: {
    findManager() {
      // 为给定 ID 的 user 创建请求
      axios
        .get("/test?id=1")
        .then(function (response) {
          alert(response.data.name);
        });
    },
  },
  data() {
    return {
      id: "1",
    };
  },
};
</script>

